﻿namespace NJQuery {
	using System;

	/// <summary>
	/// Provides event data for the <see cref="Accordion.ChangeStart" /> event.
	/// </summary>
	public class AccordionChangeStartEventArgs : EventArgs {


		#region Fields

		private AccordionPanel oldActive;
		private AccordionPanel newActive;
		private bool cancel;

		#endregion


		#region Constructors

		/// <summary>
		/// Creates a new instance of the <see cref="AccordionChangeStartEventArgs"/> class.
		/// </summary>
		/// <param name="oldActive">The currently active <see cref="AccordionPanel"/>.</param>
		/// <param name="newActive">The <see cref="AccordionPanel"/> clicked by the user to be activated unless <see cref="Cancel"/> is set to True.</param>
		public AccordionChangeStartEventArgs(AccordionPanel oldActive, AccordionPanel newActive) {
			this.oldActive = oldActive;
			this.newActive = newActive;
		}

		#endregion


		#region Properties

		/// <summary>
		/// Gets the currently active <see cref="AccordionPanel"/>.
		/// </summary>
		public virtual AccordionPanel OldActive {
			get { return oldActive; }
		}

		/// <summary>
		/// Gets the <see cref="AccordionPanel"/> clicked by the user to be activated unless <see cref="Cancel"/> is set to True.
		/// </summary>
		public virtual AccordionPanel NewActive {
			get { return newActive; }
		}

		/// <summary>
		/// Gets or sets whether or not the user interaction should be interrupted.
		/// </summary>
		public virtual bool Cancel {
			get { return cancel; }
			set { cancel = value; }
		}

		#endregion


	}

}